﻿using System;
using System.Linq.Expressions;
using NHibernate;

namespace FluentDml
{
    /// <summary>
    /// Apply a set based delete
    /// </summary>
    /// <typeparam name="T">the type to apply the set based action on</typeparam>
    public class Delete<T> : Command<T>
    {
        public Delete(ISession session, Expression<Func<T, bool>> where) : base(session, where) { }

        protected override string CreateCommandString(string alias)
        {
            string fullName = typeof(T).FullName;
            return string.Format("delete {0} as {1} ", fullName, alias);
        }
    }
}